Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented May 8, 2025

This PR refactors the handling of for directive elements, recognizing "_has_next" as Boolean and "_index" as Integer types for improved code completion, documentation, and inspections.

  • Introduces new SQL test files to verify proper handling of these elements.
  • Updates DAO interfaces and inspection/documentation generators to utilize the specified types.
  • Adjusts the ForDirectiveUtil utility to resolve type suffixes accordingly.

@xterao xterao added this to the 0.7.0 Release milestone May 8, 2025
@xterao xterao added enhancement New feature or request feature labels May 8, 2025
@xterao xterao self-assigned this May 8, 2025
@xterao xterao linked an issue May 8, 2025 that may be closed by this pull request
@xterao xterao requested a review from Copilot May 8, 2025 05:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the handling of for directive elements, recognizing "_has_next" as Boolean and "_index" as Integer types for improved code completion, documentation, and inspections.

  • Introduces new SQL test files to verify proper handling of these elements.
  • Updates DAO interfaces and inspection/documentation generators to utilize the specified types.
  • Adjusts the ForDirectiveUtil utility to resolve type suffixes accordingly.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
documentForItemIndex.sql Added SQL test for handling item_index with Boolean/Integer types.
documentForItemHasNext.sql Added SQL test for handling item_has_next with Boolean type.
completeForItemIndex.sql Added SQL test for code completion of item_index.
completeForItemHasNext.sql Added SQL test for code completion of item_has_next.
EmployeeSummaryDao/bindVariableForItemHasNextAndIndex.sql Added SQL test for binding variables with both for directive properties.
DocumentTestDao.java, SqlCompleteTestDao.java, EmployeeSummaryDao.java Updated DAO interfaces to include methods for the new tests.
Various Kotlin test and provider files Updated inspection and documentation generators to resolve for directive types.
ForDirectiveUtil.kt Added new method to resolve type suffixes to standard Java classes.
Comments suppressed due to low confidence (3)

src/test/testData/src/main/resources/META-INF/doma/example/dao/document/DocumentTestDao/documentForItemIndex.sql:4

  • [nitpick] The token 'item_index' appears to contain a typo; please ensure the identifier is spelled correctly as 'item_index' for consistency with the intended type resolution.
index = /* item_in<caret>dex */0

src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/bindVariableForItemHasNextAndIndex.sql:20

  • The reference 'member_has_next.NotTRUE' does not match any known Boolean field or constant; please update it to a valid reference that correctly resolves to a Boolean value.
and p.not_next = /* member_has_next.NotTRUE */false

src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/bindVariableForItemHasNextAndIndex.sql:22

  • The reference 'member_index.nextValue()' does not correspond to any valid method or field for an Integer type; please replace it with the appropriate reference, such as a valid static constant or method invocation.
and p.not_index = /* member_index.nextValue() */999

@xterao xterao merged commit 2dcabe8 into main May 8, 2025
3 checks passed
@xterao xterao deleted the feature/for-directive-specific-word-element-handling branch May 8, 2025 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hasNext, Index type reference

2 participants